//
//  CJSTravel.m
//  GoTraveling
//
//  Created by 陈金山 on 15/12/25.
//  Copyright © 2015年 开发华佗. All rights reserved.
//

#import "CJSTravel.h"
#import "CJSDays.h"

@implementation CJSTravel

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.users = [[User alloc] init];
        self.dayArray = [NSMutableArray array];
        self.poi = [[CJSPoi_infos alloc] init];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    
    
    if ([key isEqualToString:@"user"]) {
        [_users setValuesForKeysWithDictionary:value];
    }
    if ([key isEqualToString:@"days"]) {
        for (NSDictionary *dic in value) {
            CJSDays *days = [[CJSDays alloc] init];
            [days setValuesForKeysWithDictionary:dic];
            [self.dayArray addObject:days];
            
        }
    }
    if ([key isEqualToString:@"poi_infos_count"]) {
        [self.poi setValuesForKeysWithDictionary:value];
    }
    if ([key isEqualToString:@"id"]) {
        self.Id = value;
    }
}

@end
